<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('files', function (Blueprint $table) {
            $table->increments('id');
            $table->string('original_name', 512)->nullable()->comment('文件原名');
            $table->string('name', 512)->nullable()->comment('文件名');
            $table->string('type')->nullable()->comment('文件类型');
            $table->integer('size')->nullable()->comment('文件大小');
            $table->string('ext')->nullable()->comment('文件后缀');
            $table->string('path', 512)->nullable()->comment('文件路径');
            $table->integer('creator_id')->nullable()->comment('创建人id');
            $table->dateTime('create_time')->nullable();
            $table->dateTime('update_time')->nullable();
            $table->string('deleted_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('files');
    }
};
